<template>
    <div class="tables-wrap">
        <div class="table-header">{{ $t('inspectionManagement.version') }}：{{version}}</div>
        <el-table max-height="350" border :data="list" :loading="loading" :row-class-name="'el-drown-menu__item'">
            <el-table-column prop="projectName" label="检验项目" align="center" />
            <el-table-column prop="projectCode" label="项目编码" align="center" />
            <el-table-column prop="unitName" label="检验类型单位" align="center" />
            <el-table-column prop="unitName" label="检验类型单位" align="center" />
            <el-table-column prop="checkoutType" label="检验类型" align="center" />
            <el-table-column prop="itemFrequency" label="频率" align="center" />
            <el-table-column prop="itemFrequencyValue" label="频率值" align="center" />
            <el-table-column prop="targetValue" label="目标值" align="center" />
            <el-table-column prop="lowerLimit" label="下限值" align="center" />
            <el-table-column prop="upperLimit" label="上限值" align="center" />
            <el-table-column prop="samplingOne" label="抽样方案" align="center" />
            <el-table-column prop="samplingThree" label="样本量" align="center" />
            <el-table-column prop="detectionOne" label="检测方法" align="center" />
            <el-table-column prop="symbol" label="特殊特性" align="center" />
            <el-table-column prop="symbol" label="小数位" align="center" />
            <el-table-column :label="$t('public.opera')" fixed="right" align="center" width="160">
                <template slot-scope="scope">
                    <div class="action-wrap">
                        <img src="" alt="">
                    </div>
                </template>
            </el-table-column>
        </el-table>
    </div>

</template>

<script>
import { getCheckItem } from '@/api/basic/version'

export default {
    name: 'vTable',
    props: {
        version: [String],
        form: [Object],
    },
    data() {
        return {
            list: [],
            loading: false,
        }
    },
    mounted() {
        this.getList()
    },
    methods: {
        getList() {
            this.loading = true
            const { factoryName, materialCode, supplierCode } = this.form
            getCheckItem({
                factoryName,
                materialCode,
                supplierCode,
                version: this.version,
            }).then((res) => {
                this.loading = false
                this.list = res.data
            })
        },
    },
}
</script>

<style scoped>
.table-header {
    line-height: 32px;
    padding: 0 11px;
    font-size: 14px;
    background-color: #f7f8fa;
    border: 1px solid #dfe6ec;
    border-bottom: 0;
    color: #0b7be3;
    font-weight: 600;
}
.tables-wrap {
    margin-top: 20px;
}
</style>
